#include "mpHttpResponseMessage.h"
#include "Internal/mpHttpResponseMessageImpl.h"

using namespace MP::HTTP::INTERNAL;

namespace MP{
namespace HTTP{

/*****************************************
 * HttpResponseContent
 *****************************************/

//设置Body大小
void HttpResponseContent::setContentLength(std::size_t httpcontent_length) {
    _httpcontent_length = httpcontent_length;
}

//获取Body大小
std::size_t HttpResponseContent::getContentLength() const {
    return _httpcontent_length;
}

//设置ContentType
void HttpResponseContent::setContentType(const std::string & content_type) {
    _httpcontent_type = content_type;
}
//获取ContentType
const std::string& HttpResponseContent::getContentType() const{
    return _httpcontent_type;
}

std::string HttpResponseContent::getData() const {
    return {};
}

bool HttpResponseContent::isHttpResponseFileContent(){
    return false;
}

/****************************************************
 * HttpResponseMessage Creater
 ***************************************************/

HttpResponseMessage::ptr_s createHttpResponseMessage(){
    return std::make_shared<HttpResponseMessageImpl>();
}

HttpResponseMessage::ptr_s createHttpResponseStreamMessage(std::stringstream& sstream){
    return std::make_shared<HttpResponseMessageImpl>(sstream);
}

HttpResponseMessage::ptr_s createHttpResponseFileMessage(const std::string& filePath,
                                                         std::size_t fileOffset){
    return std::make_shared<HttpResponseMessageImpl>(filePath,fileOffset);
}



}   //HTTP
}   //MP
